<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Add Page'); ?></div>
    <?php 
        foreach(Yii::app()->admin->getFlashes() as $key => $message){
            echo '<div class="n_'.$key.'"><p>'.$message."</p></div>\n";
        }
    ?>
    <form method="post">
        <div class="element">
            <label for="name">Title <span class="red">*</span></label>
            <input type="text" name="post[post_title]" id="title" class="text required" value="<?php echo isset($arrItemInfo['post_title'])?$arrItemInfo['post_title']:null; ?>">
        </div>
        <div class="element">
            <label for="name">Body text:</label>
            <textarea name="post[post_body]" class="textarea" id="body"><?php echo isset($arrItemInfo['post_body'])?$arrItemInfo['post_body']:null; ?></textarea>
        </div>        
        <div class="entry">
        	<input type="hidden" name="post[taxonomy_id]" value="1">
            <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['post_id'])?$arrItemInfo['post_id']:null; ?>">
            <button type="submit">Preview</button> <button type="submit" class="add">Save page</button> <button class="cancel">Cancel</button>
        </div>
    </form>
</div>
<script src="../libs/ckeditor/ckeditor.js"></script>
<script>
$(function(){
	CKEDITOR.config.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre';
	CKEDITOR.replace( 'body', {
		toolbar: [
					{ name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] },
					{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
					'/',
					{ name: 'basicstyles', items: [ 'Bold', 'Italic' ] }
				]
	});
});
</script>